<?php
$this->pageTitle = 'Manage Bookmarks - ' . Yii::app()->name;
$this->sectionTitle = 'Manage Bookmarks';

$this->menu = array(
    array('label' => '<span class="bookmark-add"></span>add bookmark', 'url' => array('bookmark/create'),
        'itemOptions' => array('class' => 'action'),
        'linkOptions' => array('class' => 'button button-blue')),
);

Yii::app()->clientScript->registerScript('search', "
$('.search-button').click(function(){
	$('.search-form').toggle();
	return false;
});
$('.search-form form').submit(function(){
	$.fn.yiiGridView.update('bookmark-grid', {
		data: $(this).serialize()
	});
	return false;
});
");
?>

<?php echo CHtml::link('Advanced Search', '#', array('class' => 'search-button')); ?>
<div class="search-form" style="display:none">
<?php
    $this->renderPartial('_search', array(
    'model' => $model,
));
    ?>
</div><!-- search-form -->

<?php
$this->widget('zii.widgets.grid.CGridView', array(
    'id' => 'bookmark-grid',
    'dataProvider' => $model->search(),
    'columns' => array(
        'title',
        array(
            'name' => 'folder.name',
            'header' => 'Bookmark Folder',
        ),
        array(
            'class' => 'CButtonColumn',
        ),
    ),
    'itemsCssClass' => 'datatable full',
));
?>
